﻿using System.Data.Entity.ModelConfiguration;
using yiCommerce.Core.Domain.FriendShips;
using yiCommerce.Core.Domain.Securitys;

namespace yiCommerce.Data.Mapping.FriendShips
{
    public class FriendShipMapping: EntityTypeConfiguration<FriendShip>
    {
        public FriendShipMapping()
        {
            this.ToTable("FriendShip");
            this.HasKey(pr => pr.Id);


            this.HasRequired(pc => pc.Owner)
                .WithMany()
                .HasForeignKey(pc => pc.OwnerId).WillCascadeOnDelete(false);

            this.HasRequired(pc => pc.Friend)
                .WithMany()
                .HasForeignKey(pc => pc.FriendId).WillCascadeOnDelete(false);
        }
    }
}